#ifndef AVALON_BUFFERWRITER_HPP
#define AVALON_BUFFERWRITER_HPP
#include "Avalon/IO/Buffer.hpp"
#include "Avalon/IO/Writer.hpp"

namespace Avalon {
namespace IO {

  /*! \class BufferWriter
   *  \brief Writes to a Buffer.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class BufferWriter : public Writer {
    public:

      //! Constructs a BufferWriter.
      BufferWriter();

      virtual ~BufferWriter();

      //! Returns the Buffer being written to.
      const Buffer& GetBuffer();

      virtual Threading::Async<void>::Ptr Write(const void* data, int size);

      virtual Threading::Async<void>::Ptr Write(const Buffer& data);

    private:
      Buffer m_buffer;
  };
}
}

#endif // AVALON_BUFFERWRITER_HPP
